﻿@using SuCasa.DataAccess
@using SuCasa.Infrastructure
@model SuCasa.Models.MemberAddEntryViewModel
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="page-header">
    <h2>@(ViewBag.Title)
        Member</h2>
</div>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm("Add", "Member", FormMethod.Post, new { @class = "form-horizontal" }))
{
    @Html.ValidationSummary(true)
    <div class="control-group">
        <label class="control-label">
            Member Type:</label>
        <div class="controls">
            @Html.DropDownListFor(x => x.MemberTypeId, new SelectList(MemberTypes.Instance.All, "MemberTypeId", "MemberTypeDesc"))
        </div>
    </div>    
				
    @Html.HiddenFor(x => x.MemberId)
    <div class="control-group">
        <label class="control-label">
            First Name</label>
        <div class="controls">
            @Html.EditorFor(model => model.FirstName, new { @class = "input-xlarge" })
            @Html.ValidationMessageFor(model => model.FirstName)
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">
            Middle Name</label>
        <div class="controls">
            @Html.EditorFor(model => model.MiddleName, new { @class = "input-xlarge" })
            @Html.ValidationMessageFor(model => model.MiddleName)
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">
            Last Name</label>
        <div class="controls">
            @Html.EditorFor(model => model.LastName, new { @class = "input-xlarge" })
            @Html.ValidationMessageFor(model => model.LastName)
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">
            Address1</label>
        <div class="controls">
            @Html.EditorFor(model => model.Address1, new { @class = "input-xlarge" })
            @Html.ValidationMessageFor(model => model.Address1)
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">
            Address2</label>
        <div class="controls">
            @Html.EditorFor(model => model.Address2, new { @class = "input-xlarge" })
            @Html.ValidationMessageFor(model => model.Address2)
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">
            Address3</label>
        <div class="controls">
            @Html.EditorFor(model => model.Address3, new { @class = "input-xlarge" })
            @Html.ValidationMessageFor(model => model.Address3)
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">
            City</label>
        <div class="controls">
            @Html.EditorFor(model => model.City, new { @class = "input-xlarge" })
            @Html.ValidationMessageFor(model => model.City)
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">
            State</label>
        <div class="controls">
            @Html.EditorFor(model => model.State, new { @class = "input-xlarge" })
            @Html.ValidationMessageFor(model => model.State)
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">
            PostalCode</label>
        <div class="controls">
            @Html.EditorFor(model => model.PostalCode, new { @class = "input-xlarge" })
            @Html.ValidationMessageFor(model => model.PostalCode)
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">
            Date Of Birth</label>
        <div class="controls">
            @Html.TextBoxFor(model => model.DateOfBirth, new { @class = "input-xlarge datepicker", id = "txtDateOfBirth" })
            @Html.ValidationMessageFor(model => model.DateOfBirth)
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">
            Home Phone</label>
        <div class="controls">
            @Html.EditorFor(model => model.HomePhone, new { @class = "input-xlarge" })
            @Html.ValidationMessageFor(model => model.HomePhone)
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">
            Cell Phone</label>
        <div class="controls">
            @Html.EditorFor(model => model.CellPhone, new { @class = "input-xlarge" })
            @Html.ValidationMessageFor(model => model.CellPhone)
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">
            Email</label>
        <div class="controls">
            @Html.EditorFor(model => model.Email, new { @class = "input-xlarge" })
            @Html.ValidationMessageFor(model => model.Email)
        </div>
    </div>

        

    <div class="control-group">
        <label class="control-label">
            Country Of Origin</label>
        <div class="controls">
            @Html.EditorFor(model => model.CountryOfOrigin, new { @class = "input-xlarge" })
            @Html.ValidationMessageFor(model => model.CountryOfOrigin)
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">
            US Entrance Date</label>
        <div class="controls">
            @Html.TextBoxFor(model => model.UsEntranceDate, new { @id = "entrance-date" })
            @Html.ValidationMessageFor(model => model.UsEntranceDate)
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">
            Associated Church</label>
        <div class="controls">
            @Html.EditorFor(model => model.AssociatedChurch, new { @class = "input-xlarge" })
            @Html.ValidationMessageFor(model => model.AssociatedChurch)
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">
            Associate Parent</label>
        <div class="controls">
            @Html.DropDownListFor(x => x.ParentMemberId, new SelectList(Model.Members ?? new List<Member>(), "MemberId", "Name"), string.Empty)
            @Html.ValidationMessageFor(model => model.Members)
        </div>
    </div>    
    <div class="control-group">
        <label class="control-label">
            Picture</label>
        <div class="controls">
            <input type="file" id="myFileUpload" />
        </div>
    </div>
    
    <div class="form-actions">
        <input type="submit" class="btn btn-primary" value="@(ViewBag.Title)" />
    </div>


}
<div>
    @Html.ActionLink("Back to List", "Index", "Home")
</div>
<script>
    (function () {
        $("#entrance-date").datepicker();
        $("#txtDateOfBirth").datepicker();
    })();
</script>
